﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ListenMusic.Song_ServiceReference;
using ListenMusic.Models.Public;
using System.ServiceModel;
namespace ListenMusic.Controllers.Public
{
    public class MP3Controller : HomeController
    {
        private SongRepository sop;
        public MP3Controller()
        {
            sop = new SongRepository();
        }
        public ActionResult ListenPage(int sid)
        {            
            try
            {
                DataContract_Song song  = sop.getSongById(sid);
                return View(song);
            }
            catch (FaultException ex)
            {
                throw ex;
            }          
        }       
        public ActionResult ListSong_Album(int aid)
        {             
            try
            {
               List<Song> lst_song = sop.getSongByAlbumID(aid);
                return View(lst_song);
            }
            catch (FaultException ex)
            {
                throw ex;
            }           
        }
    }
}
